<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateHolidaysTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('holidays', function (Blueprint $table) {
            $table->id();
            $table->integer('date')->default(0)->comment('日期');
            $table->tinyInteger('isHoliday')->default(0)->comment('0上班 1休息');
            $table->string('name', 16)->default('')->comment('名称');


            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '节假日';

            $table->index('date', 'idx_date');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('holidays');
    }
}
